import {
  ajax
} from "@/config/apiServer/axios-config.js";
import {
  URLS
} from "@/config/apiServer/urls.js";

// 获取消息列表
export function getMsgList(form) {
  return ajax({
    type: 'get',
    typeData: true,
    url: URLS.MESSAGE_LIST,
    params: form
  })
}
// 添加消息
export function addMsg(form) {
  return ajax({
    type: 'post',
    url: URLS.MESSAGE_ADD,
    params: form
  })
}
// 获取消息详情
export function getMsgDetail(id) {
  return ajax({
    type: 'get',
    typeData: true,
    url: URLS.MESSAGE_DETAIL,
    params: {
      id
    }
  })
}
// 更新消息
export function updateMsg(form) {
  return ajax({
    type: 'put',
    url: URLS.MESSAGE_UPDATE,
    params: form
  })
}
// 删除消息
export function delMsg(id) {
  return ajax({
    type: 'delete',
    url: URLS.MESSAGE_DEL,
    params: {
      id
    }
  })
}